package test.jusfy.com.myapplication;

import android.app.Application;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.widget.TableLayout;

/**
 * Created by Administrator on 2017/9/13 0013.
 */

public class MyApplication extends Application{

    private static MyApplication application;

    @Override
    public void onCreate() {
        super.onCreate();
        application = this;

    }

    public static Context getAppContext(){
        return application;
    }

    public static Cursor query(String sql,String[] selectionArgs){
        SQLiteDatabase db = SQLDataBaseManager.getInstance().openDataBase(getAppContext());
        return db.rawQuery(sql,selectionArgs);
    }
}
